﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Api.Model
{
    public class Tag : IEquatable<Tag>
    {
        public string Name { get; set; }

        public override bool Equals(object obj)
        {
            var tag2 = obj as Tag;

            if (tag2 != null)
            {
                return tag2.Name == Name;
            }
            else
            {
                return false;
            }      
        }

        public override int GetHashCode()
        {
            if (Name != null)
            {
                return Name.GetHashCode();
            }

            return 0;
        }

        public bool Equals(Tag other)
        {
            if (other == null)
            {
                return false;
            }

            return this.Name == other.Name;
        }
    }
}
